home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / maximus / maxkit20.zip / WIDLST20.ZIP / WIDLST20.MEX next >
Text File  |  1996-02-07  |  3KB  |  95 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Free for non-commercial use.       FREQ MAXKIT for new Sysop set.
  3. // Desc: changed to print list or both, Gerry Ellison 1:108/107
  4. // Copyright 1995 1996 rry Ellison.  All rights reserved.
  5. // $Id: WIDLST20.MEX 1.5 1996/1/1 24:00:00 gre Exp $
  6. // USAGE: [mex]M\WIDLST20.MEX,  for unattended list printing.
  7. //////////////////////////////////////////////////////////////////////////////
  8.  
  9. #include <max.mh>
  10.  
  11. int main()
  12. {
  13.         int:   ok,
  14.                 i,
  15.                fd;
  16.  
  17.      string: line,
  18.           bbsname,
  19.         path_file,
  20.                 z;
  21.  
  22.     char: nonstop,
  23.                ch;
  24.  
  25.   struct _usr: u;
  26.  
  27.   reset_more(nonstop);
  28.  
  29.   // -----------------------------------------------------
  30.   // put the path and file name "C:\\BBS\\Logs\\WUSER.LST"
  31.            path_file := "C:\\Max\\WUSER.LST";
  32.   // -----------------------------------------------------
  33.  
  34.   bbsname := " From The Mountain Top BBS!  1:108/107";
  35.   print("\f ░░░░░▒▒▒▒▒▓▓▓▓▓█████████        WIDELST1.MEX        █" +
  36.         "████████▓▓▓▓▓▒▒▒▒▒░░░░░\n");
  37.  
  38.  
  39.     print(COL_YELLOW, "\n" + bbsname +"\n");
  40.     print(COL_LGREEN "\n   Using NAME, LOCATION, PHONE, PRIV, UPLOAD, DNLOAD, LASTCALLED, #CALLS\n");
  41.  line := strpadleft("Total number of users = ",49,' ') +
  42.           ltostr(userfilesize());
  43.   print(line + "\n");
  44.         print(COL_LCYAN "\n   Creating " + path_file + " USER # " + COL_YELLOW);
  45.  
  46.   fd := open(path_file, IOPEN_CREATE | IOPEN_WRITE);
  47.  
  48.   line := "\n" + strpadleft("The Mountain Top BBS Userlist.",54,' ');
  49.   writeln(fd, line);
  50.  
  51.   line := strpadleft("Total number of users = ",49,' ') +
  52.           ltostr(userfilesize());
  53.   writeln(fd, line);
  54.  
  55.  line := "\n      NAME                      LOCATION                    PHONE    PRIV " +
  56.          "UPLOAD    DNLOAD   LASTCALLED #CALLS\n";
  57.   writeln(fd, line);
  58.  
  59.   i := 1;
  60.  
  61.   for (ok := userfindopen("","",u);
  62.        ok AND do_more(nonstop, COL_CYAN);
  63.  
  64.        ok := userfindnext(u))
  65.   {                                              // start through list
  66.  
  67.      if (i >0 and i <10)
  68.         z := "\b";
  69.      if (i >10 or i >100)
  70.         z := "\b\b";
  71.      if (i >100)
  72.         z := "\b\b\b";
  73.      print(z,i);
  74.      i := i + 1;
  75.  
  76.  line := strpad(u.name,22,' ') +
  77.      strpad(u.city,32,' ') +
  78.      strpad(u.phone,14,' ') +
  79.      " " + strpad(uitostr(u.priv),4,' ') +
  80.      " " + strpad(uitostr(u.up),9,' ') +
  81.      " " + strpad(uitostr(u.down),9,' ') +
  82.      substr(stamp_string(u.ludate),1,10) +
  83.             " " + strpad(uitostr(u.times),9,' ');
  84.  
  85.      writeln(fd, line);
  86.      }
  87.     line := "\n" + " -----------------------------------"
  88.         + "---------------------------------------";
  89.     writeln(fd, line);
  90.     close(fd);
  91.  
  92.         print("\n\n");
  93.         return 0;
  94. }
  95.